import javax.swing.*;

/**
 * Keafmd
 *
 * @ClassName: Demo7
 * @Description: Demo7
 * @author: lijl
 * @date: 2022/12/11 14:36
 * @Blog: https://keafmd.blog.csdn.net/
 */

public class Demo7 {
    public static void main(String[] args) {
        String str=JOptionPane.showInputDialog("Please Input an Double Data");
        double r=Double.parseDouble(str);
        double result=Math.PI*r*r;
        JOptionPane.showMessageDialog(null,"圆的面积为："+result,"输出结果",JOptionPane.INFORMATION_MESSAGE);
    }
    public static void main3(String[] args) {
        JOptionPane.showMessageDialog(null, "这是一个信息提示对话框", "标题", JOptionPane.INFORMATION_MESSAGE);
        JOptionPane.showMessageDialog(null, "这是一个信息提示对话框", "标题", JOptionPane.ERROR_MESSAGE);
        JOptionPane.showMessageDialog(null, "这是一个信息提示对话框", "标题", JOptionPane.WARNING_MESSAGE);
        JOptionPane.showMessageDialog(null, "这是一个信息提示对话框", "标题", JOptionPane.QUESTION_MESSAGE);
        JOptionPane.showMessageDialog(null, "这是一个信息提示对话框", "标题", JOptionPane.PLAIN_MESSAGE);
    }
    public static void main2(String[] args) {
        String inputValue=JOptionPane.showInputDialog("Please input a value");
        System.out.println("您输入的信息是:"+inputValue);
    }
    public static void main1(String[] args) {
        int response=JOptionPane.showConfirmDialog(null,"这是一个确认对话框","标题",JOptionPane.YES_NO_OPTION);
        if(response==0){
            System.out.println("你单击了'是'按钮");}
        if(response==1){
            System.out.println("你单击了'否'按钮");}
    }
}
